package mvp.com.bbc.rcjavaretrofitdaggermvp.mvp.fragment;

import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.View;
import android.widget.Button;

import mvp.com.bbc.rcjavaretrofitdaggermvp.R;
import mvp.com.bbc.rcjavaretrofitdaggermvp.baseAF.BaseFragment;
import mvp.com.bbc.rcjavaretrofitdaggermvp.mvp.wihget.LikeStar;
import mvp.com.bbc.rcjavaretrofitdaggermvp.mvp.wihget.MyView1;
import mvp.com.bbc.rcjavaretrofitdaggermvp.mvp.wihget.MyViewCircle;

/**
 * Created by ${cbf} on 2017/11/24.
 * 自定义贝塞尔曲线
 */

public class BezierFragment extends BaseFragment {
    private MyView1 myview;
    private Button btn;
    private MyViewCircle myViewCircle;
    private LikeStar mLikeStar;
    @Override
    protected int setContentLayout() {
        return R.layout.view_fragment;
    }

    @Override
    protected void findViews() {
    }

    @Override
    protected void init() {
     /*   //三阶
        myview = (MyView1) baseView.findViewById(R.id.myview);
        btn = (Button) baseView.findViewById(R.id.btn);
        btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                myview.setControlPointTwo(!myview.isControlPointTwo());
            }
        });*/

       // 圆变心
        myViewCircle = (MyViewCircle)baseView. findViewById(R.id.myview);

        btn = (Button) baseView.findViewById(R.id.btn);
        btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                myViewCircle.setRuning(true);
            }
        });

        //点赞效果
        mLikeStar = (LikeStar)baseView. findViewById(R.id.likestar);
        btn = (Button) baseView.findViewById(R.id.btn);
        btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mLikeStar.startRunning();
            }
        });

    }

    @Override
    protected void setListeners() {

    }

    @Override
    public void onClick(View view) {

    }
    public static Fragment Instance(Context context, String mall) {
        BezierFragment homeFragment = new BezierFragment();
        Bundle bundle = new Bundle();
        bundle.putString("name", mall);
        homeFragment.setArguments(bundle);
        return homeFragment;
    }
}
